import 'package:flutter/material.dart';
import '../Search.dart';
import '../../components/MyDialog.dart';

class HomePage extends StatefulWidget {
  HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/appBarDemo');
          },
          child: Text("跳转到appbar"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/tabController');
          },
          child: Text("TabController定义顶部tab切换"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/button');
          },
          child: Text("跳转到按钮演示页面"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/buttonExtend');
          },
          child: Text("跳转到按钮演示页面flutter2.x"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/textField');
          },
          child: Text("跳转到表单演示页面"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/checkbox');
          },
          child: Text("跳转到checkbox"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/radio');
          },
          child: Text("跳转到radio switch"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/formDemo');
          },
          child: Text("跳转到表单实战"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/datePicker');
          },
          child: Text("跳转到官方日期组件"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/datePickerPub');
          },
          child: Text("跳转到第三方日期组件"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/swiper');
          },
          child: Text("跳转到Swiper"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, '/dialog');
          },
          child: Text("跳转到dialog"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
        RaisedButton(
          onPressed: () {
            showDialog(
                context: context,
                builder: (context) {
                  return new MyDialog(
                    content: '关于我们',
                    title: '关于我们',
                  );
                });
          },
          child: Text("展示自定义dialog"),
          color: Theme.of(context).accentColor,
          textTheme: ButtonTextTheme.primary,
        ),
      ],
    );
  }
}
